3.2.50 \(\int \frac {(d+e x) (f+g x+h x^2)}{a+b x+c x^2} \, dx\) [150]

3.2.50.1 Optimal result
3.2.50.2 Mathematica [A] (verified)
3.2.50.3 Rubi [A] (verified)
3.2.50.4 Maple [A] (verified)
3.2.50.5 Fricas [A] (verification not implemented)
3.2.50.6 Sympy [B] (verification not implemented)
3.2.50.7 Maxima [F(-2)]
3.2.50.8 Giac [A] (verification not implemented)
3.2.50.9 Mupad [B] (verification not implemented)

3.2.50.1 Optimal result

Integrand size = 28, antiderivative size = 177 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=\frac {(c e g+c d h-b e h) x}{c^2}+\frac {e h x^2}{2 c}-\frac {\left (2 c^3 d f-b^3 e h-c^2 (b e f+b d g+2 a e g+2 a d h)+b c (b e g+b d h+3 a e h)\right ) \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^3 \sqrt {b^2-4 a c}}+\frac {\left (c^2 (e f+d g)+b^2 e h-c (b e g+b d h+a e h)\right ) \log \left (a+b x+c x^2\right )}{2 c^3} \]

output
(-b*e*h+c*d*h+c*e*g)*x/c^2+1/2*e*h*x^2/c+1/2*(c^2*(d*g+e*f)+b^2*e*h-c*(a*e 
*h+b*d*h+b*e*g))*ln(c*x^2+b*x+a)/c^3-(2*c^3*d*f-b^3*e*h-c^2*(2*a*d*h+2*a*e 
*g+b*d*g+b*e*f)+b*c*(3*a*e*h+b*d*h+b*e*g))*arctanh((2*c*x+b)/(-4*a*c+b^2)^ 
(1/2))/c^3/(-4*a*c+b^2)^(1/2)
 
3.2.50.2 Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 173, normalized size of antiderivative = 0.98 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=\frac {2 c (c e g+c d h-b e h) x+c^2 e h x^2-\frac {2 \left (-2 c^3 d f+b^3 e h+c^2 (b e f+b d g+2 a e g+2 a d h)-b c (b e g+b d h+3 a e h)\right ) \arctan \left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\sqrt {-b^2+4 a c}}+\left (c^2 (e f+d g)+b^2 e h-c (b e g+b d h+a e h)\right ) \log (a+x (b+c x))}{2 c^3} \]

input
Integrate[((d + e*x)*(f + g*x + h*x^2))/(a + b*x + c*x^2),x]
 
output
(2*c*(c*e*g + c*d*h - b*e*h)*x + c^2*e*h*x^2 - (2*(-2*c^3*d*f + b^3*e*h + 
c^2*(b*e*f + b*d*g + 2*a*e*g + 2*a*d*h) - b*c*(b*e*g + b*d*h + 3*a*e*h))*A 
rcTan[(b + 2*c*x)/Sqrt[-b^2 + 4*a*c]])/Sqrt[-b^2 + 4*a*c] + (c^2*(e*f + d* 
g) + b^2*e*h - c*(b*e*g + b*d*h + a*e*h))*Log[a + x*(b + c*x)])/(2*c^3)
 
3.2.50.3 Rubi [A] (verified)

Time = 0.43 (sec) , antiderivative size = 177, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {2159, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(d+e x) \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx\)

\(\Big \downarrow \) 2159

\(\displaystyle \int \left (\frac {x \left (-c (a e h+b d h+b e g)+b^2 e h+c^2 (d g+e f)\right )+a b e h-a c (d h+e g)+c^2 d f}{c^2 \left (a+b x+c x^2\right )}+\frac {-b e h+c d h+c e g}{c^2}+\frac {e h x}{c}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {\text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (-c^2 (2 a d h+2 a e g+b d g+b e f)+b c (3 a e h+b d h+b e g)+b^3 (-e) h+2 c^3 d f\right )}{c^3 \sqrt {b^2-4 a c}}+\frac {\log \left (a+b x+c x^2\right ) \left (-c (a e h+b d h+b e g)+b^2 e h+c^2 (d g+e f)\right )}{2 c^3}+\frac {x (-b e h+c d h+c e g)}{c^2}+\frac {e h x^2}{2 c}\)

input
Int[((d + e*x)*(f + g*x + h*x^2))/(a + b*x + c*x^2),x]
 
output
((c*e*g + c*d*h - b*e*h)*x)/c^2 + (e*h*x^2)/(2*c) - ((2*c^3*d*f - b^3*e*h 
- c^2*(b*e*f + b*d*g + 2*a*e*g + 2*a*d*h) + b*c*(b*e*g + b*d*h + 3*a*e*h)) 
*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(c^3*Sqrt[b^2 - 4*a*c]) + ((c^2*( 
e*f + d*g) + b^2*e*h - c*(b*e*g + b*d*h + a*e*h))*Log[a + b*x + c*x^2])/(2 
*c^3)
 

3.2.50.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2159
Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p 
_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*Pq*(a + b*x + c*x^2)^p, x 
], x] /; FreeQ[{a, b, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
 
3.2.50.4 Maple [A] (verified)

Time = 0.82 (sec) , antiderivative size = 192, normalized size of antiderivative = 1.08

method result size
default \(-\frac {-\frac {1}{2} c e h \,x^{2}+b e h x -c d h x -c e g x}{c^{2}}+\frac {\frac {\left (-a e h c +b^{2} e h -b c d h -b c e g +c^{2} d g +c^{2} e f \right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (b a e h -a c d h -a c e g +c^{2} d f -\frac {\left (-a e h c +b^{2} e h -b c d h -b c e g +c^{2} d g +c^{2} e f \right ) b}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}}{c^{2}}\) \(192\)
risch \(\text {Expression too large to display}\) \(8247\)

input
int((e*x+d)*(h*x^2+g*x+f)/(c*x^2+b*x+a),x,method=_RETURNVERBOSE)
 
output
-1/c^2*(-1/2*c*e*h*x^2+b*e*h*x-c*d*h*x-c*e*g*x)+1/c^2*(1/2*(-a*c*e*h+b^2*e 
*h-b*c*d*h-b*c*e*g+c^2*d*g+c^2*e*f)/c*ln(c*x^2+b*x+a)+2*(b*a*e*h-a*c*d*h-a 
*c*e*g+c^2*d*f-1/2*(-a*c*e*h+b^2*e*h-b*c*d*h-b*c*e*g+c^2*d*g+c^2*e*f)*b/c) 
/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2)))
 
3.2.50.5 Fricas [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 654, normalized size of antiderivative = 3.69 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=\left [\frac {{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e h x^{2} + \sqrt {b^{2} - 4 \, a c} {\left ({\left (2 \, c^{3} d - b c^{2} e\right )} f - {\left (b c^{2} d - {\left (b^{2} c - 2 \, a c^{2}\right )} e\right )} g + {\left ({\left (b^{2} c - 2 \, a c^{2}\right )} d - {\left (b^{3} - 3 \, a b c\right )} e\right )} h\right )} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c - \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) + 2 \, {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e g + {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d - {\left (b^{3} c - 4 \, a b c^{2}\right )} e\right )} h\right )} x + {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e f + {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d - {\left (b^{3} c - 4 \, a b c^{2}\right )} e\right )} g - {\left ({\left (b^{3} c - 4 \, a b c^{2}\right )} d - {\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} e\right )} h\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )}}, \frac {{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e h x^{2} - 2 \, \sqrt {-b^{2} + 4 \, a c} {\left ({\left (2 \, c^{3} d - b c^{2} e\right )} f - {\left (b c^{2} d - {\left (b^{2} c - 2 \, a c^{2}\right )} e\right )} g + {\left ({\left (b^{2} c - 2 \, a c^{2}\right )} d - {\left (b^{3} - 3 \, a b c\right )} e\right )} h\right )} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + 2 \, {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e g + {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d - {\left (b^{3} c - 4 \, a b c^{2}\right )} e\right )} h\right )} x + {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e f + {\left ({\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d - {\left (b^{3} c - 4 \, a b c^{2}\right )} e\right )} g - {\left ({\left (b^{3} c - 4 \, a b c^{2}\right )} d - {\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} e\right )} h\right )} \log \left (c x^{2} + b x + a\right )}{2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )}}\right ] \]

input
integrate((e*x+d)*(h*x^2+g*x+f)/(c*x^2+b*x+a),x, algorithm="fricas")
 
output
[1/2*((b^2*c^2 - 4*a*c^3)*e*h*x^2 + sqrt(b^2 - 4*a*c)*((2*c^3*d - b*c^2*e) 
*f - (b*c^2*d - (b^2*c - 2*a*c^2)*e)*g + ((b^2*c - 2*a*c^2)*d - (b^3 - 3*a 
*b*c)*e)*h)*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c - sqrt(b^2 - 4*a*c)*(2* 
c*x + b))/(c*x^2 + b*x + a)) + 2*((b^2*c^2 - 4*a*c^3)*e*g + ((b^2*c^2 - 4* 
a*c^3)*d - (b^3*c - 4*a*b*c^2)*e)*h)*x + ((b^2*c^2 - 4*a*c^3)*e*f + ((b^2* 
c^2 - 4*a*c^3)*d - (b^3*c - 4*a*b*c^2)*e)*g - ((b^3*c - 4*a*b*c^2)*d - (b^ 
4 - 5*a*b^2*c + 4*a^2*c^2)*e)*h)*log(c*x^2 + b*x + a))/(b^2*c^3 - 4*a*c^4) 
, 1/2*((b^2*c^2 - 4*a*c^3)*e*h*x^2 - 2*sqrt(-b^2 + 4*a*c)*((2*c^3*d - b*c^ 
2*e)*f - (b*c^2*d - (b^2*c - 2*a*c^2)*e)*g + ((b^2*c - 2*a*c^2)*d - (b^3 - 
 3*a*b*c)*e)*h)*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) + 2* 
((b^2*c^2 - 4*a*c^3)*e*g + ((b^2*c^2 - 4*a*c^3)*d - (b^3*c - 4*a*b*c^2)*e) 
*h)*x + ((b^2*c^2 - 4*a*c^3)*e*f + ((b^2*c^2 - 4*a*c^3)*d - (b^3*c - 4*a*b 
*c^2)*e)*g - ((b^3*c - 4*a*b*c^2)*d - (b^4 - 5*a*b^2*c + 4*a^2*c^2)*e)*h)* 
log(c*x^2 + b*x + a))/(b^2*c^3 - 4*a*c^4)]
 
3.2.50.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1265 vs. \(2 (182) = 364\).

Time = 6.20 (sec) , antiderivative size = 1265, normalized size of antiderivative = 7.15 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=x \left (- \frac {b e h}{c^{2}} + \frac {d h}{c} + \frac {e g}{c}\right ) + \left (- \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (3 a b c e h - 2 a c^{2} d h - 2 a c^{2} e g - b^{3} e h + b^{2} c d h + b^{2} c e g - b c^{2} d g - b c^{2} e f + 2 c^{3} d f\right )}{2 c^{3} \cdot \left (4 a c - b^{2}\right )} - \frac {a c e h - b^{2} e h + b c d h + b c e g - c^{2} d g - c^{2} e f}{2 c^{3}}\right ) \log {\left (x + \frac {2 a^{2} c e h - a b^{2} e h + a b c d h + a b c e g + 4 a c^{3} \left (- \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (3 a b c e h - 2 a c^{2} d h - 2 a c^{2} e g - b^{3} e h + b^{2} c d h + b^{2} c e g - b c^{2} d g - b c^{2} e f + 2 c^{3} d f\right )}{2 c^{3} \cdot \left (4 a c - b^{2}\right )} - \frac {a c e h - b^{2} e h + b c d h + b c e g - c^{2} d g - c^{2} e f}{2 c^{3}}\right ) - 2 a c^{2} d g - 2 a c^{2} e f - b^{2} c^{2} \left (- \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (3 a b c e h - 2 a c^{2} d h - 2 a c^{2} e g - b^{3} e h + b^{2} c d h + b^{2} c e g - b c^{2} d g - b c^{2} e f + 2 c^{3} d f\right )}{2 c^{3} \cdot \left (4 a c - b^{2}\right )} - \frac {a c e h - b^{2} e h + b c d h + b c e g - c^{2} d g - c^{2} e f}{2 c^{3}}\right ) + b c^{2} d f}{3 a b c e h - 2 a c^{2} d h - 2 a c^{2} e g - b^{3} e h + b^{2} c d h + b^{2} c e g - b c^{2} d g - b c^{2} e f + 2 c^{3} d f} \right )} + \left (\frac {\sqrt {- 4 a c + b^{2}} \cdot \left (3 a b c e h - 2 a c^{2} d h - 2 a c^{2} e g - b^{3} e h + b^{2} c d h + b^{2} c e g - b c^{2} d g - b c^{2} e f + 2 c^{3} d f\right )}{2 c^{3} \cdot \left (4 a c - b^{2}\right )} - \frac {a c e h - b^{2} e h + b c d h + b c e g - c^{2} d g - c^{2} e f}{2 c^{3}}\right ) \log {\left (x + \frac {2 a^{2} c e h - a b^{2} e h + a b c d h + a b c e g + 4 a c^{3} \left (\frac {\sqrt {- 4 a c + b^{2}} \cdot \left (3 a b c e h - 2 a c^{2} d h - 2 a c^{2} e g - b^{3} e h + b^{2} c d h + b^{2} c e g - b c^{2} d g - b c^{2} e f + 2 c^{3} d f\right )}{2 c^{3} \cdot \left (4 a c - b^{2}\right )} - \frac {a c e h - b^{2} e h + b c d h + b c e g - c^{2} d g - c^{2} e f}{2 c^{3}}\right ) - 2 a c^{2} d g - 2 a c^{2} e f - b^{2} c^{2} \left (\frac {\sqrt {- 4 a c + b^{2}} \cdot \left (3 a b c e h - 2 a c^{2} d h - 2 a c^{2} e g - b^{3} e h + b^{2} c d h + b^{2} c e g - b c^{2} d g - b c^{2} e f + 2 c^{3} d f\right )}{2 c^{3} \cdot \left (4 a c - b^{2}\right )} - \frac {a c e h - b^{2} e h + b c d h + b c e g - c^{2} d g - c^{2} e f}{2 c^{3}}\right ) + b c^{2} d f}{3 a b c e h - 2 a c^{2} d h - 2 a c^{2} e g - b^{3} e h + b^{2} c d h + b^{2} c e g - b c^{2} d g - b c^{2} e f + 2 c^{3} d f} \right )} + \frac {e h x^{2}}{2 c} \]

input
integrate((e*x+d)*(h*x**2+g*x+f)/(c*x**2+b*x+a),x)
 
output
x*(-b*e*h/c**2 + d*h/c + e*g/c) + (-sqrt(-4*a*c + b**2)*(3*a*b*c*e*h - 2*a 
*c**2*d*h - 2*a*c**2*e*g - b**3*e*h + b**2*c*d*h + b**2*c*e*g - b*c**2*d*g 
 - b*c**2*e*f + 2*c**3*d*f)/(2*c**3*(4*a*c - b**2)) - (a*c*e*h - b**2*e*h 
+ b*c*d*h + b*c*e*g - c**2*d*g - c**2*e*f)/(2*c**3))*log(x + (2*a**2*c*e*h 
 - a*b**2*e*h + a*b*c*d*h + a*b*c*e*g + 4*a*c**3*(-sqrt(-4*a*c + b**2)*(3* 
a*b*c*e*h - 2*a*c**2*d*h - 2*a*c**2*e*g - b**3*e*h + b**2*c*d*h + b**2*c*e 
*g - b*c**2*d*g - b*c**2*e*f + 2*c**3*d*f)/(2*c**3*(4*a*c - b**2)) - (a*c* 
e*h - b**2*e*h + b*c*d*h + b*c*e*g - c**2*d*g - c**2*e*f)/(2*c**3)) - 2*a* 
c**2*d*g - 2*a*c**2*e*f - b**2*c**2*(-sqrt(-4*a*c + b**2)*(3*a*b*c*e*h - 2 
*a*c**2*d*h - 2*a*c**2*e*g - b**3*e*h + b**2*c*d*h + b**2*c*e*g - b*c**2*d 
*g - b*c**2*e*f + 2*c**3*d*f)/(2*c**3*(4*a*c - b**2)) - (a*c*e*h - b**2*e* 
h + b*c*d*h + b*c*e*g - c**2*d*g - c**2*e*f)/(2*c**3)) + b*c**2*d*f)/(3*a* 
b*c*e*h - 2*a*c**2*d*h - 2*a*c**2*e*g - b**3*e*h + b**2*c*d*h + b**2*c*e*g 
 - b*c**2*d*g - b*c**2*e*f + 2*c**3*d*f)) + (sqrt(-4*a*c + b**2)*(3*a*b*c* 
e*h - 2*a*c**2*d*h - 2*a*c**2*e*g - b**3*e*h + b**2*c*d*h + b**2*c*e*g - b 
*c**2*d*g - b*c**2*e*f + 2*c**3*d*f)/(2*c**3*(4*a*c - b**2)) - (a*c*e*h - 
b**2*e*h + b*c*d*h + b*c*e*g - c**2*d*g - c**2*e*f)/(2*c**3))*log(x + (2*a 
**2*c*e*h - a*b**2*e*h + a*b*c*d*h + a*b*c*e*g + 4*a*c**3*(sqrt(-4*a*c + b 
**2)*(3*a*b*c*e*h - 2*a*c**2*d*h - 2*a*c**2*e*g - b**3*e*h + b**2*c*d*h + 
b**2*c*e*g - b*c**2*d*g - b*c**2*e*f + 2*c**3*d*f)/(2*c**3*(4*a*c - b**...
 
3.2.50.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=\text {Exception raised: ValueError} \]

input
integrate((e*x+d)*(h*x^2+g*x+f)/(c*x^2+b*x+a),x, algorithm="maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` for 
 more deta
 
3.2.50.8 Giac [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 189, normalized size of antiderivative = 1.07 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=\frac {c e h x^{2} + 2 \, c e g x + 2 \, c d h x - 2 \, b e h x}{2 \, c^{2}} + \frac {{\left (c^{2} e f + c^{2} d g - b c e g - b c d h + b^{2} e h - a c e h\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{3}} + \frac {{\left (2 \, c^{3} d f - b c^{2} e f - b c^{2} d g + b^{2} c e g - 2 \, a c^{2} e g + b^{2} c d h - 2 \, a c^{2} d h - b^{3} e h + 3 \, a b c e h\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} c^{3}} \]

input
integrate((e*x+d)*(h*x^2+g*x+f)/(c*x^2+b*x+a),x, algorithm="giac")
 
output
1/2*(c*e*h*x^2 + 2*c*e*g*x + 2*c*d*h*x - 2*b*e*h*x)/c^2 + 1/2*(c^2*e*f + c 
^2*d*g - b*c*e*g - b*c*d*h + b^2*e*h - a*c*e*h)*log(c*x^2 + b*x + a)/c^3 + 
 (2*c^3*d*f - b*c^2*e*f - b*c^2*d*g + b^2*c*e*g - 2*a*c^2*e*g + b^2*c*d*h 
- 2*a*c^2*d*h - b^3*e*h + 3*a*b*c*e*h)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a* 
c))/(sqrt(-b^2 + 4*a*c)*c^3)
 
3.2.50.9 Mupad [B] (verification not implemented)

Time = 0.58 (sec) , antiderivative size = 273, normalized size of antiderivative = 1.54 \[ \int \frac {(d+e x) \left (f+g x+h x^2\right )}{a+b x+c x^2} \, dx=x\,\left (\frac {d\,h+e\,g}{c}-\frac {b\,e\,h}{c^2}\right )-\frac {\ln \left (c\,x^2+b\,x+a\right )\,\left (b^4\,e\,h-4\,a\,c^3\,d\,g-4\,a\,c^3\,e\,f-b^3\,c\,d\,h-b^3\,c\,e\,g+b^2\,c^2\,d\,g+b^2\,c^2\,e\,f+4\,a^2\,c^2\,e\,h+4\,a\,b\,c^2\,d\,h+4\,a\,b\,c^2\,e\,g-5\,a\,b^2\,c\,e\,h\right )}{2\,\left (4\,a\,c^4-b^2\,c^3\right )}-\frac {\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}\right )\,\left (b^3\,e\,h-2\,c^3\,d\,f+2\,a\,c^2\,d\,h+2\,a\,c^2\,e\,g+b\,c^2\,d\,g+b\,c^2\,e\,f-b^2\,c\,d\,h-b^2\,c\,e\,g-3\,a\,b\,c\,e\,h\right )}{c^3\,\sqrt {4\,a\,c-b^2}}+\frac {e\,h\,x^2}{2\,c} \]

input
int(((d + e*x)*(f + g*x + h*x^2))/(a + b*x + c*x^2),x)
 
output
x*((d*h + e*g)/c - (b*e*h)/c^2) - (log(a + b*x + c*x^2)*(b^4*e*h - 4*a*c^3 
*d*g - 4*a*c^3*e*f - b^3*c*d*h - b^3*c*e*g + b^2*c^2*d*g + b^2*c^2*e*f + 4 
*a^2*c^2*e*h + 4*a*b*c^2*d*h + 4*a*b*c^2*e*g - 5*a*b^2*c*e*h))/(2*(4*a*c^4 
 - b^2*c^3)) - (atan(b/(4*a*c - b^2)^(1/2) + (2*c*x)/(4*a*c - b^2)^(1/2))* 
(b^3*e*h - 2*c^3*d*f + 2*a*c^2*d*h + 2*a*c^2*e*g + b*c^2*d*g + b*c^2*e*f - 
 b^2*c*d*h - b^2*c*e*g - 3*a*b*c*e*h))/(c^3*(4*a*c - b^2)^(1/2)) + (e*h*x^ 
2)/(2*c)